package com.ce.pms.charge.vo;

import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

import com.sitechasia.webx.core.model.IViewObject;

public class SectionStandardVO implements IViewObject,
		Comparable<SectionStandardVO> {
	/**
	 * 主键
	 */
	private Long sectStaId;

	/**
	 * 收费标准版本ID
	 */
	private Long staHisId;

	/**
	 * 区段单价
	 */
	private BigDecimal price;

	/**
	 * 起点
	 */
	private BigDecimal startPoint;

	/**
	 * 迄点
	 */
	private BigDecimal toPoint;

	/**
	 * 操作人
	 */
	private Long creator;

	/**
	 * 修改人
	 */
	private Long modifier;

	public Long getCreator() {
		return creator;
	}

	public void setCreator(Long creator) {
		this.creator = creator;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public Long getSectStaId() {
		return sectStaId;
	}

	public void setSectStaId(Long sectStaId) {
		this.sectStaId = sectStaId;
	}

	public BigDecimal getStartPoint() {
		return startPoint;
	}

	public void setStartPoint(BigDecimal startPoint) {
		this.startPoint = startPoint;
	}

	public BigDecimal getToPoint() {
		return toPoint;
	}

	public void setToPoint(BigDecimal toPoint) {
		this.toPoint = toPoint;
	}

	/**
	 * @return the modifier
	 */
	public Long getModifier() {
		return modifier;
	}

	/**
	 * @param modifier
	 *            the modifier to set
	 */
	public void setModifier(Long modifier) {
		this.modifier = modifier;
	}

	/**
	 * @return the staHisId
	 */
	public Long getStaHisId() {
		return staHisId;
	}

	/**
	 * @param staHisId
	 *            the staHisId to set
	 */
	public void setStaHisId(Long staHisId) {
		this.staHisId = staHisId;
	}

	public int compareTo(SectionStandardVO other) {
		if (this.startPoint.max(other.getStartPoint()).equals(
				other.getStartPoint()))
			return -1;
		else if (this.startPoint.max(other.getStartPoint()).equals(
				this.startPoint))
			return 1;
		else
			return 0;
	}

	@Override
	public int hashCode() {
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result
				+ ((startPoint == null) ? 0 : startPoint.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final SectionStandardVO other = (SectionStandardVO) obj;
		if (startPoint == null) {
			if (other.startPoint != null)
				return false;
		} else if (!startPoint.equals(other.startPoint))
			return false;
		return true;
	}

	public SectionStandardVO(BigDecimal price, BigDecimal startPoint,
			BigDecimal toPoint) {
		this.price = price;
		this.startPoint = startPoint;
		this.toPoint = toPoint;
	}


	public SectionStandardVO() {
	}



}
